package com.example.springboot.service;

import com.example.springboot.entity.Inventory;
import com.example.springboot.mapper.InventoryMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

//注入springboot容器
@Service
public class InventoryService {
    @Autowired
    private InventoryMapper inventoryMapper;

    /**
     * 查询库存信息
     */
    public List<Inventory> selectAll() {
        return inventoryMapper.selectAll();
    }

    public List<Inventory> selectById(Long id) {
        return inventoryMapper.selectById(id);

    }

    public List<Inventory> selectByProductName(String name) {
        return inventoryMapper.selectByProductName(name);
    }

    public List<Inventory> selectByCategory(String category) {
        return inventoryMapper.selectByCategory(category);
    }

    public List<Inventory> selectByBrand(String brand) {
        return inventoryMapper.selectByBrand(brand);
    }

    public List<Inventory> selectBySupplier(String supplier) {
        return inventoryMapper.selectBySupplier(supplier);
    }
}
